/*
 * @Descriptions: reactApp
 * @version: 1.0
 * @Author: CQY
 * @Date: 2022-03-30 09:48:01
 * @LastEditors: CQY
 * @LastEditTime: 2022-04-01 09:15:49
 */
import React from 'react';
import { Table,ConfigProvider } from 'antd';
// 引入国际化 默认中文文案
import zhCN from 'antd/lib/locale/zh_CN';

// table渲染表头 行数据
const data = [
    {
      key: '1',
      orders: 'DD2022033023050',
      customer: '星河入梦',
      goodsName: '王者',
      goodsIcon:'',
      saleCount:1,
      discount:0,
      totalAmount:170,
      remark:'备注',
      seller:'超级管理员',
      saleDate:"2022/3/30 23:06:44"
    },
    {
      key: '2',
      orders: 'DD2022033017260',
      customer: '南京和利时',
      goodsName: '系统默认产品',
      goodsIcon:'',
      saleCount:1,
      discount:0,
      totalAmount:900,
      remark:'备注',
      seller:"超级管理员",
      saleDate:"2022/3/30 17:27:41",
    },
    {
        key: '3',
        orders: 'DD2022033017260',
        customer: 'helishi',
        goodsName: '系统默认产品',
        goodsIcon:'',
        saleCount:1,
        discount:0,
        totalAmount:900,
        remark:'备注',
        seller:"超级管理员",
        saleDate:"2022/3/30 09:22:32",
    },
  ];
  
  // table渲染表头 列数据
  const columns = [
    {
      title: '订单',
      dataIndex: 'orders',
      key: 'orders',
      align:"center",
      height:"100px"
    },
    {
      title: '客户名称',
      dataIndex: 'customer',
      key: 'customer',
      align:"center",
    },
    {
      title: '商品名称',
      dataIndex: 'goodsName',
      key: 'goodsName',
      align:"center",
    },
    {
        title: '商品图',
        dataIndex: 'goodsIcon',
        key: 'goodsIcon',
        align:"center",
    },
    {
        title: '销售数量',
        dataIndex: 'saleCount',
        key: 'saleCount',
        align:"center",
    },
    {
        title: '折扣',
        dataIndex: 'discount',
        key: 'discount',
        align:"center",
    },
    {
        title: '总金额',
        dataIndex: 'remark',
        key: 'remark',
        align:"center",
    },
    {
        title: '销售员',
        dataIndex: 'seller',
        key: 'seller',
        align:"center",
    },
    {
        title: '销售时间',
        dataIndex: 'saleDate',
        key: 'saleDate',
        align:"center",
    },
  ];

const SaleRecord = () => {
    return (
        <div>
            <ConfigProvider locale={zhCN}>
                <Table
                bordered
                dataSource={data}
                columns={columns}
                pagination={
                    {
                        defaultPageSize:10,
                        showLessItems:true,
                        showQuickJumper:true,
                        showSizeChanger:true,
                        total:data.length,
                        showTotal:total=>`总共 ${total}条`,
                        pageSizeOptions:[10,20,50],
                    }
                }
                 />     
            </ConfigProvider>
        </div>
    );
}

export default SaleRecord;
